package com.jn.okhttp.views;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.jn.okhttp.R;
import com.jn.okhttp.contract.DictionaryContact;
import com.jn.okhttp.entity.Dictionary;
import com.jn.okhttp.presenter.DictionaryPresenter;

public class DictionaryFragment extends Fragment implements DictionaryContact.DictionaryView , View.OnClickListener{
    private DictionaryContact.DictionaryPresenter dPresenter ;
    private Dictionary.DataDictionary dData ;
    private View view ;
    private EditText dInput ;
    private ImageButton dSea ;


    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        if (view == null){
            view = inflater.inflate(R.layout.dictionary , container , false);
            init();
        }
        return view ;
    }

    private void init(){
        dInput = view.findViewById(R.id.dInput);
        dSea = view.findViewById(R.id.dSea);
        dPresenter = new DictionaryPresenter(this, getContext());
        dSea.setOnClickListener(this);
    }

    @Override
    public void onHttpLoading() {

    }

    @Override
    public void showData(Dictionary data) {

    }

    @Override
    public void onHttpLoading(boolean loading) {

    }

    @Override
    public void onHttpFail(String... msg) {

    }

    @Override
    public void onHttpTimeout() {

    }

    @Override
    public void onHttpTokenExpiration() {

    }


    private String getExplain(String[] array){
        StringBuilder sb = new StringBuilder();
        for (String s : array){
            sb.append(s + "\n");
        }
        return sb.toString();
    }


    @Override
    public void onClick(View v) {

    }
}
